home *** CD-ROM | disk | FTP | other *** search
- /************************************************************
- *
- * Created: Wednesday, November 24, 1993 19:25:00
- *
- * CNeoScrapStream.h
- *
- * C++ class implementation for a scrap stream class
- *
- * Most C++ compilers include a standard set of classes which
- * implement an input/output facility which is referred to as
- * a stream. The most common stream class supports the
- * transfer of basic C data types such as integers, floating-
- * point numbers and character strings to and from a file.
- *
- * While streams have been around for some time, our
- * understanding of them continues to evolve. We know, for
- * example, that we need different types of streams for
- * different purposes. Application-specific environments may
- * benefit from the use of a stream subclass which also
- * supports application-specific data types, an imaginary
- * number for instance. Other environments may find useful a
- * stream that transfers data not to a file but across a
- * network pipe or an interprocess communications channel. As
- * you can see from these two examples, there are two
- * directions in which stream derivations can occur. One
- * direction addresses the type of data being accessed. The
- * other defines the source/destination of the data.
- *
- * NeoAccess releases 2.2 and later use a construct called a
- * stream to address the issue of where data is coming from or
- * going to. The abstract base class CNeoStream provides an
- * interface through which basic data types can be read in or
- * written out. This base class is subclassed to build a stream
- * class, CNeoFileStream, for reading from and writing to a
- * file.
- *
- * The NeoAccess database class, CNeoDatabase, provides an
- * extremely powerful mechanism for accessing persistent objects.
- * These objects use persistence properties provided by their
- * base class, CNeoPersist. And together these three base
- * classes - CNeoStream, CNeoDatabase and CNeoPersist - create an
- * incredibly powerful and high performance database engine which
- * is both extensible and easy to use.
- *
- * Copyright © Neologic Systems 1992-1994. All Rights Reserved.
- * All rights reserved
- *
- *
- ***********************************************************/
- #pragma once /* Include this file only once */
- #ifndef __CNeoScrapStream__
- #define __CNeoScrapStream__ 1
-
- #include "NeoTypes.h"
-
- #include CNeoStreamH
-
- const OSType kNeoScrapStreamID = 'scrp';
-
- class CNeoScrapStream : public CNeoStream
- {
- public:
- /** Instance Methods **/
- CNeoScrapStream(const OSType aType);
- ~CNeoScrapStream(void);
-
- /** Access Methods **/
- virtual void flush(void);
- virtual OSType getStreamType(void) const {return kNeoScrapStreamID;}
- virtual OSType getType(void) const {return fType;}
- virtual void setType(const OSType aType) {fType = aType;}
-
- /** I/O Methods **/
- virtual NeoBlob readBlob(const NeoMark aMark, long &aLength, const NeoTag aTag = kNeoNoTag);
- virtual void readChunk(void *aBuffer, const long aLength, const NeoTag aTag = kNeoNoTag);
- virtual void readObject(CNeoPersist *aObject, const NeoTag aTag = kNeoNoTag);
-
- virtual void writeBlob(NeoBlob aBlob, const NeoMark aMark, const long aLength, const NeoTag aTag = kNeoNoTag);
- virtual void writeChunk(const void *aBuffer, const long aLength, const NeoTag aTag = kNeoNoTag);
- virtual void writeObject(CNeoPersist *aObject, const NeoTag aTag = kNeoNoTag);
-
- protected:
- long fOffset; // Offset into the memory block
- Handle fData; // Handle to scrap data
- OSType fType; // The type of scrap
- };
-
- #endif